package com.buka.communicate.fragment;

import android.content.Intent;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.LinearLayout;
import android.widget.RelativeLayout;
import android.widget.TextView;

import com.buka.communicate.R;
import com.buka.communicate.activity.CoinGetActivity;
import com.buka.communicate.activity.DayTaskActivity;
import com.buka.communicate.activity.FriendsCircleActivity;
import com.buka.communicate.activity.FubowGetActivity;
import com.buka.communicate.activity.GiftActivity;
import com.buka.communicate.activity.InfoEditActivity;
import com.buka.communicate.activity.MallActivity;
import com.buka.communicate.activity.RegistActivity;
import com.buka.communicate.activity.SettingActivity;
import com.buka.communicate.activity.SkillActivity;
import com.buka.communicate.activity.VipActivity;
import com.buka.communicate.activity.VipActivity_;
import com.buka.communicate.activity.WalletActivity;
import com.facebook.drawee.view.SimpleDraweeView;

import net.neiquan.applibrary.base.BaseFragment;

import butterknife.ButterKnife;
import butterknife.InjectView;
import butterknife.OnClick;

/**
 * Created by Administrator on 2017/11/8 0008.
 */

public class MineFragment extends BaseFragment {
    @InjectView(R.id.mHeadImg)
    SimpleDraweeView mHeadImg;
    @InjectView(R.id.vipTv)
    TextView vipTv;
    @InjectView(R.id.mNameTv)
    TextView mNameTv;
    @InjectView(R.id.mIdTv)
    TextView mIdTv;
    @InjectView(R.id.mNumTv)
    TextView mNumTv;
    @InjectView(R.id.mLeveTv)
    TextView mLeveTv;
    @InjectView(R.id.mHeadLL)
    LinearLayout mHeadLL;
    @InjectView(R.id.mMoneyTv)
    TextView mMoneyTv;
    @InjectView(R.id.mMoneyRv)
    RelativeLayout mMoneyRv;
    @InjectView(R.id.mDiamondTv)
    TextView mDiamondTv;
    @InjectView(R.id.mDiamondRv)
    RelativeLayout mDiamondRv;
    @InjectView(R.id.mCoinTv)
    TextView mCoinTv;
    @InjectView(R.id.mCoinRv)
    RelativeLayout mCoinRv;
    @InjectView(R.id.mTaskTv)
    TextView mTaskTv;
    @InjectView(R.id.mTaskRv)
    RelativeLayout mTaskRv;
    @InjectView(R.id.mSkillRv)
    RelativeLayout mSkillRv;
    @InjectView(R.id.mLevelTv)
    TextView mLevelTv;
    @InjectView(R.id.mLevelRv)
    RelativeLayout mLevelRv;
    @InjectView(R.id.mDaynmicRv)
    RelativeLayout mDaynmicRv;
    @InjectView(R.id.mMallRv)
    RelativeLayout mMallRv;
    @InjectView(R.id.mGiftRv)
    RelativeLayout mGiftRv;
    @InjectView(R.id.mSettingRv)
    RelativeLayout mSettingRv;

    @Override
    public int getRootViewId() {
        return R.layout.fragment_mine;
    }

    @Override
    public void setViews() {
        setTitleTv("我");
        setBackGone();
    }

    @Override
    public void initData() {
        mHeadImg.setImageURI("http://img2.imgtn.bdimg.com/it/u=266057472,3867980612&fm=27&gp=0.jpg");
    }


    @OnClick({R.id.vipTv, R.id.mHeadLL, R.id.mMoneyRv, R.id.mDiamondRv, R.id.mCoinRv, R.id.mTaskRv, R.id.mSkillRv, R.id.mLevelRv, R.id.mDaynmicRv, R.id.mMallRv, R.id.mGiftRv, R.id.mSettingRv})
    public void onViewClicked(View view) {
        switch (view.getId()) {
            case R.id.vipTv:
                startActivity(new Intent(getActivity(), VipActivity_.class));
                break;
            case R.id.mHeadLL:
                startActivity(new Intent(getActivity(),InfoEditActivity.class));
                break;
            case R.id.mMoneyRv:
                startActivity(new Intent(getActivity(),FubowGetActivity.class));
                break;
            case R.id.mDiamondRv:
                startActivity(new Intent(getActivity(),WalletActivity.class));
                break;
            case R.id.mCoinRv:
                startActivity(new Intent(getActivity(),CoinGetActivity.class));
                break;
            case R.id.mTaskRv:
                startActivity(new Intent(getActivity(),DayTaskActivity.class));
                break;
            case R.id.mSkillRv:
                startActivity(new Intent(getActivity(),SkillActivity.class));
                break;
            case R.id.mLevelRv:
                break;
            case R.id.mDaynmicRv:
                startActivity(new Intent(getActivity(),FriendsCircleActivity.class));
                break;
            case R.id.mMallRv:
                startActivity(new Intent(getActivity(),MallActivity.class));
                break;
            case R.id.mGiftRv:
                startActivity(new Intent(getActivity(),GiftActivity.class));
                break;
            case R.id.mSettingRv:
                startActivity(new Intent(getActivity(),SettingActivity.class));
                break;
        }
    }


    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
        // TODO: inflate a fragment view
        View rootView = super.onCreateView(inflater, container, savedInstanceState);
        ButterKnife.inject(this, rootView);
        return rootView;
    }

    @Override
    public void onDestroyView() {
        super.onDestroyView();
        ButterKnife.reset(this);
    }
}
